package net.ojbk.study.twobox.beans.form.post;

import net.ojbk.study.twobox.beans.form.InputItem;
import net.ojbk.study.twobox.beans.po.Refer;
import net.ojbk.study.twobox.beans.vo.SelectOption;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: twobox
 * Date: 2019/4/16
 * Time: 10:33
 * Description: 咨询表查询表单
 */
@Component
public class ReferPostForm extends SupperPostForm<Refer> {

    InputItem inputItemStaff = new InputItem("质询师",
            "userid",
            "", "select");

    public ReferPostForm() throws Exception {

        this.inputItems.add(new InputItem("学生姓名",
                "username",
                "",
                "text"));

        List<SelectOption> genderList = new ArrayList<>();
        // 网站|现场|电话|邮件
        genderList.add(new SelectOption("男", "男"));
        genderList.add(new SelectOption("女", "女"));
        this.inputItems.add(new InputItem("性别",
                "gender",
                "男",
                "select", genderList));

        List<SelectOption> sourceList = new ArrayList<>();
        // 网站|现场|电话|邮件
        sourceList.add(new SelectOption("网站", "网站"));
        sourceList.add(new SelectOption("现场", "现场"));
        sourceList.add(new SelectOption("电话", "电话"));
        sourceList.add(new SelectOption("邮件", "邮件"));
        this.inputItems.add(new InputItem("咨询来源",
                "source",
                "网站",
                "select", sourceList));


        List<SelectOption> rstateList = new ArrayList<>();
        // 质询中|已报名|结束
        rstateList.add(new SelectOption("咨询中", "咨询中"));
        rstateList.add(new SelectOption("已报名", "已报名"));
        rstateList.add(new SelectOption("结束", "结束"));
        this.inputItems.add(new InputItem("咨询状态",
                "rstate",
                "咨询中",
                "select", rstateList));


        List<SelectOption> resourcelevelList = new ArrayList<>();
        resourcelevelList.add(new SelectOption("A", "A"));
        resourcelevelList.add(new SelectOption("B", "B"));
        resourcelevelList.add(new SelectOption("C", "C"));
        resourcelevelList.add(new SelectOption("D", "D"));
        this.inputItems.add(new InputItem("资源级别",
                "resourcelevel",
                "A",
                "select", resourcelevelList));

        // 工作状态
        List<SelectOption> isjobList = new ArrayList<>();
        // 在职|应届生
        isjobList.add(new SelectOption("1", "在职"));
        isjobList.add(new SelectOption("0", "应届生"));
        this.inputItems.add(new InputItem("工作状态",
                "isjob",
                "1",
                "select", isjobList));

        // 联系电话
        this.inputItems.add(new InputItem("联系电话",
                "phone",
                "",
                "text"));

        // 身份证号 idcard
        this.inputItems.add(new InputItem("身份证号",
                "idcard",
                "",
                "text"));

        // 微信号 weixin
        this.inputItems.add(new InputItem("微信号",
                "weixin",
                "",
                "text"));
        // QQ号码 qq
        this.inputItems.add(new InputItem("QQ号码",
                "qq",
                "",
                "text"));

        // 联系地址 address
        this.inputItems.add(new InputItem("联系地址",
                "address",
                "",
                "text"));
        // 邮箱地址 email
        this.inputItems.add(new InputItem("邮箱地址",
                "email",
                "",
                "text"));
        // 毕业院校 byacademy
        this.inputItems.add(new InputItem("毕业院校",
                "byacademy",
                "",
                "text"));

        // userid
        this.inputItems.add(this.inputItemStaff);
        // 备注 remark
        this.inputItems.add(new InputItem("备注",
                "remark",
                "",
                "text"));

    }

    @Override
    public List<InputItem> getInputItems() throws Exception {
        this.inputItemStaff.setOther(this.selectOptionUtil.getSelectOptionListByName("staff"));
        return super.getInputItems();
    }
}
